Implement Groundwater module#135
Conversation
- Added Groundwater module with 2D Boussinesq Diffusion Solver logic. - Implemented Darcy Flux kernel (Kernel 1) and Mass Balance & Seepage kernel (Kernel 2). - Added support for spatially variable groundwater parameters: Hydraulic Conductivity (K_gw), Saturated Infiltration Rate (fs_gw), Specific Yield (Sy_gw), and Aquifer Depth. - Integrated the module into the main GPU flow loop, replacing the default infiltration model when active. - Updated data structures, input parsing, memory management, and initial conditions to handle groundwater variables. - Added groundwater parameters and head (hgw) to the output variables mapping. Co-authored-by: CyprienBosserelle <3713631+CyprienBosserelle@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Added Groundwater module with 2D Boussinesq Diffusion Solver. - Implemented Darcy Flux kernels for X and Y directions. - Implemented Mass Balance and Seepage kernel with infiltration and volume transfer. - Added support for spatially variable groundwater parameters (K_gw, fs_gw, Sy_gw, Aquifer_Depth). - Integrated into GPU flow loop, replacing default infiltration when active. - Corrected various signatures and utility calls (utils::max/min, Copy2CartCPU). - Added necessary halo filling steps for groundwater head and fluxes. - Updated NetCDF output mapping for the new variables. Co-authored-by: CyprienBosserelle <3713631+CyprienBosserelle@users.noreply.github.com>
- Implemented Darcy Flux (Kernel 1) and Mass Balance & Seepage (Kernel 2) in src/groundwater.cu. - Added GroundwaterCFLGPU kernel to compute stability constraints for groundwater diffusion. - Supported spatially variable groundwater parameters (K_gw, fs_gw, Sy_gw, Aquifer_Depth) and initial head (hgw_init). - Integrated groundwater calculation and CFL condition into the main GPU flow loop. - Added necessary halo filling for hgw and Darcy fluxes. - Updated input parsing, memory management, initialization, and output mapping to support the new module. - Ensured state consistency by updating zs when surface water depth changes due to groundwater interaction. Co-authored-by: CyprienBosserelle <3713631+CyprienBosserelle@users.noreply.github.com>
Fix parameter to Copy2CartCPU for initial groundwater (use nblk, not nblk*blksize). Read and initialize static groundwater forcings in readforcing (set denanval and call readstaticforcing). Comment out legacy parameter parsing for groundwater in ReadInput. Copy groundwater arrays to GPU in Setup_GPU when groundwater is enabled. Major refactor in groundwater.cu: introduce GroundwaterCFLGPU to compute local GW diffusion-limited dt, add CalctimestepGWGPU host routine to densify/reduce dtmax and compute n_substeps, adjust DarcyFluxX/Y signatures/logic, and run GW model with substepping (fill halo, compute fluxes, update mass balance) to keep GW timestepping in sync with surface water. Update groundwater.h with required includes. Templates for GPU kernels are explicitly instantiated.
- Redesigned Darcy Flux and Mass Balance kernels to ensure conservative volume transfer and correct face indexing. - Implemented GroundwaterCFLGPU kernel to provide stability constraints for the 2D Boussinesq Diffusion Solver. - Integrated groundwater calculations and CFL limitation into the main GPU flow loop in FlowGPU.cu. - Added support for spatially variable groundwater parameters (K_gw, fs_gw, Sy_gw, Aquifer_Depth) and initial head (hgw_init). - Added aliases for input parameters (zs_gw_init, zb_gw) to match validation nomenclature. - Implemented Aquifer_Depth calculation from aquifer bed elevation (zb - zb_gw) if provided. - Ensured robust memory management, initialization, and GPU data transfer for all new variables. - Added hgw, Qx, Qy, and physical parameters to the NetCDF output mapping. - Corrected utility calls and included missing headers in groundwater.cu. - Ensured state consistency (zs = zb + h) after seepage and infiltration. Co-authored-by: CyprienBosserelle <3713631+CyprienBosserelle@users.noreply.github.com>
…rsion)" This reverts commit 00f3c3c.
- Reverted 'zb_gw' and 'zs_gw_init' aliases to keep parameters strictly as specified. - Optimized Darcy Flux and Mass Balance kernels for conservative volume transfer and correct face indexing. - Added support for spatially variable K_gw, fs_gw, Sy_gw, and Aquifer_Depth. - Integrated stability-limited time step (CFL) for groundwater diffusion. - Included necessary halo filling steps for head and Darcy fluxes. - Corrected various utility signatures (Copy2CartCPU) and ensured state consistency. - Mapped all groundwater variables for optional NetCDF output. Co-authored-by: CyprienBosserelle <3713631+CyprienBosserelle@users.noreply.github.com>
This reverts commit 47361be.




I have implemented the Groundwater module for BG_Flood as specified.
The implementation includes:
Param.h,Forcing.h, andArrays.hto include groundwater flags, constant parameters, and spatially variable maps for K_gw, fs_gw, Sy_gw, and Aquifer_Depth. Added a new groundwater head variablehgw.ReadInput.cuandReadForcing.cuto parse groundwater parameters fromBG_param.txtand load parameter maps. UpdatedMemManagement.cuto handle allocation/reallocation of the new arrays on both CPU and GPU.InitialConditions.cuto initialize groundwater parameters and the initial headhgw(defaulting to topography elevation if not specified).groundwater.handgroundwater.cucontaining the CUDA kernels for Darcy flux calculation and groundwater mass balance/seepage.FlowGPU.cu, where it replaces the existing infiltration model when enabled.The Darcy flux uses the effective head (H_gw + H_sw) and is calculated using the local cell size. The mass balance kernel handles lateral flux, infiltration (capped by surface water depth and saturated infiltration rate), and seepage (transferring volume back to the surface when
hgw > zb).PR created automatically by Jules for task 15222133803072565313 started by @CyprienBosserelle